-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution #715
base: master
Are you sure you want to change the base?
Solution #715
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It`s ok. You can try also create method smth like "taking_damage" for the Animal, and just call it in the end of your staticmethod instead of using nested check
app/main.py
Outdated
|
||
def dead(self) -> None: | ||
if self.health <= 0: | ||
self.alive.remove(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u should to use class name instead of self)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, but could you explain why?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`couse alive its class atribute but not object of class)
app/main.py
Outdated
self.name = name | ||
self.health = health | ||
self.hidden = hidden | ||
self.alive.append(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same about self, use class name instead
No description provided.